<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>用户登录</title>
<link rel="stylesheet" type="text/css" href="css/public.css" />
<link rel="stylesheet" type="text/css" href="css/page.css" />
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/public.js"></script>
<script type="text/javascript" src="js/jquery-2.1.1.js"></script>
</head>
<body>
	<!-- 登录页面头部 -->
	<div class="logHead">
		<img src="img/logLogo.png" />
	</div>
	<!-- 登录页面头部结束 -->
	<form action="login.do" method="post" onsubmit="return isExsit()">
	<!-- 登录body -->
	<div class="logDiv">
		<img class="logBanner" src="img/logBanner.png" height="833px"/>
		<div class="logGet">
			<!-- 头部提示信息 -->
			<div class="logD logDtip">
				<p class="p1">登录</p>
				<p class="p2">有点人员登录</p>
			</div>
			<!-- 输入框 -->
			<div class="lgD">
				<img class="img1" src="img/logName.png" /><input type="text" name="username" id="username"
					placeholder="输入用户名" />
			</div>
			<div class="lgD">
				<img class="img1" src="img/logPwd.png" /><input type="password" name="password" id="password"
					placeholder="输入用户密码" />
			</div>
			<div class="lgD logD2">
				<input class="getYZM" type="text" id="getYZM"/>
				<div class="logYZM" style="width:140px">
					<a href="javascript:void(0)" onclick="reload()"  id="reload"><img src="YZM.jsp" id="YZM" /></a>
					<span id="image" style="height:46px;width:100px;text-align:center"></span>
				</div>
			</div>
			<div class="logC">
				<button>登 录</button>
			</div>
		</div>
	</div>
	</form>
</body>

<script type="text/javascript">
	$(".getYZM").keyup(function(){
		$("#image").html("");
		var yzm=$(this).val();
		$.ajax({
			url:"checkyzm.do",
			type:"GET",
			data:"yzm="+yzm,
			dataType:"json",
			success:function(result){
				$("#image").html(result.msg);
			},
		});
	});

function reload(){
	$("#YZM").attr("src","YZM.jsp?="+Math.random());
}

function isExsit(){
	if($("#username").val()!=null && $("#password").val()!=null && $("#image").html()=="输入正确" && $("#getYZM").val()!=null){
		return true;
	}else{
		return false;
	}
} 
</script>
</html>